package submarines;

/**
 *
 * @author elad + shiran
 * This class holds general configuration constants
 */
public class Config {
    /*
     * Board related constants
     * @BOARD_SIZE marks the size of the board, useful for debugging with smaller boards
     * @BOARD_START index of the first row and column in the board
     */
    public static final int BOARD_SIZE = 10;
    public static final int BOARD_START = 0;
    public static final int HORIZONTAL = 1; // meuzan
    public static final int VERTICAL = 2; //meunah
    
    /*
     * Square constants, to define how we mark the diffrent boards. the strings will be used in console.
     */
    public static final char EMPTY_SQUARE_SIGN = '-';
    public static final char HIT_SQUARE_SIGN = 'X';
    public static final char MARKED_SQUARE_SIGN = '@';
    public static final char MISSED_SQUARE_SIGN = 'O';
    public static final char SUB_SQUARE_SIGN = '#';
    
    public static final int[] SUB_SQUARE_COLOR = {128, 128, 128};
    public static final int[] EMPTY_SQUARE_COLOR = {195, 195, 195};
    public static final int SQUARE_SIZE = 300;
    /*
     * @SUBMARINES is a useful array that will define how many battleships of each size will be in the board,
     *      i.e, SUBMARINES[3] = 4 means that there will be 4 battleships of size 3
     */
    public static final int[] SUBMARINES = {0, 1, 2, 1, 1};
    //public static final int[] SUBMARINES = {0, 1};
    public static final String[][] ALIASES = {{""}, {"PATROL_BOAT"}, {"SUBMARINE", "DESTROYER"}, {"BATTLESHIP"}, {"AIRCRAFT_CARRIER"}}; 
    public static final String[] DEATHCAUSE = {"Alive", "You were eliminated", "You haven't played for 2 min and got thrown out"}; 
    public static final int AIRCRAFT_CARRIER = 5;
    public static final int BATTLESHIP = 4;
    public static final int DESTROYER = 3;
    public static final int SUBMARINE = 3;
    public static final int PATROL_BOAT = 2;
    
    public static final int MAX_PLAYERS = 6;
    public static final int MIN_PLAYERS = 2;
    
    public static final String COMPUTER_PLAYER = "computer";
    public static final String HUMAN_PLAYER = "human";
    
    public static final String OS = "linux";
//    public static final String OS = "windows";
    
    public static String[][] cloneAliases() {
        String[][] cloned = {{""}, {""}, {"", ""}, {""}, {""}}; ;
        String tmp1,tmp2;
        int i,j;
               
        for (i = 0; i < ALIASES.length; i++) {
            for (j = 0; j < ALIASES[i].length; j++) {
                tmp1 = ALIASES[i][j];
                cloned[i][j] = tmp1;
                //cloned[i][j] = tmp2;
            }
        }
        return cloned;
    }
    
    public static enum turnStatus {
        MISSED,
        HIT,
        SHIP_SANK,
        PLAYER_LOST
    }
    
    public static int MS_TO_MIN = 1000*60;
    public static int TIMEOUT = 2;
}
